package PTA_JAVA.JavaB.Javademo25;

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);

        int num = Integer.parseInt(sc.nextLine());
        ArrayList<Employee> e = new ArrayList<>();
        for (int i = 0; i < num; i++) {
            String[] s = sc.nextLine().split("\\s+");
            Employee em = new Employee();
            try{
                if(s.length!=5){
                    throw new Exception("input error");
                }else{
                    //id
                    try{
                        em.setId(Integer.parseInt(s[0]));
                    }catch(Exception ex){
                        System.out.println(ex);
                    }
                    try{
                        for(Employee f:e){
                            if(f.getId()==Integer.parseInt(s[0])){
                                throw new Exception("id repeat");
                            }
                        }
                    }catch(Exception ex){
                        System.out.println("line:"+(i+1)+(ex.getClass()+": ").replace("class","")+ex.getMessage());
                        continue;
                    }
                    //name
                    try{
                        em.setName(s[1]);
                    }catch(Exception ex){
                        System.out.println("line:"+(i+1)+(ex.getClass()+": ").replace("class","")+ex.getMessage());
                        continue;
                    }
                    //age
                    try{
                        em.setAge(Integer.parseInt(s[2]));
                    }catch(Exception ex){
                        System.out.println("line:"+(i+1)+(ex.getClass()+": ").replace("class","")+ex.getMessage());
                        continue;
                    }
                    //position
                    try{
                        em.setPosition(s[3]);
                    }catch(Exception ex){
                        System.out.println("line:"+(i+1)+(ex.getClass()+": ").replace("class","")+ex.getMessage());
                        continue;
                    }
                    //salary
                    try{
                        em.setSalary(Double.parseDouble(s[4]));
                    }catch(Exception ex){
                        System.out.println("line:"+(i+1)+(ex.getClass()+": ").replace("class","")+ex.getMessage());
                        continue;
                    }
                    e.add(em);
                }

            }catch(Exception ex){
                System.out.println("line:"+(i+1)+(ex.getClass()+": ").replace("class","")+ex.getMessage());
            }
        }
        for(Employee i:e){
            System.out.println(i);
        }
    }
}
class Employee{
    private int id;
    private String name;
    private int age;
    private String position;
    private double salary;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public String toString() {
        return "Employee [" +
                "id=" + id +
                ", name=" + name +
                ", age=" + age +
                ", position=" + position +
                ", salary=" + salary +
                "]";
    }
}